using System;

namespace GridRegulator
{
    public class GrayImage
    {
    /* variables */
        byte[] mImage = null;
        int mWidth = 0, mHeight = 0;

    /* properties */
        public byte this[int y, int x]
        {
            get
            {
                return mImage[y*mWidth+x];
            }
            set
            {
                mImage[y*mWidth+x] = value;
            }
        }
        public byte this[int i]
        {
            get
            {
                return mImage[i];
            }
            set
            {
                mImage[i] = value;
            }
        }

        public int Width
        {
            get
            {
                return mWidth;
            }
        }
        public int Height
        {
            get
            {
                return mHeight;
            }
        }

    /* constructors */
        public GrayImage(int w, int h)
        {
            mWidth = w;
            mHeight = h;
            mImage = new byte[h*w];
        }
    }

}   /* namespace GridRegulator */